# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pylibemu
pkgname=('python2-pylibemu' 'python-pylibemu')
_pkgname=pylibemu
pkgver=1.0
pkgrel=2
pkgdesc='A Libemu Cython wrapper.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/pylibemu/#files'
license=('GPL2')
makedepends=('python2-setuptools' 'python-setuptools' 'cython2' 'cython'
             'libemu' 'python2-pip' 'python-pip' 'python2-wheel' 'python-wheel'
             'python-setuptools' 'python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('3425d3c3a57cb5a970cdc80a1479af9a192e179544ec403c4417ffc6ca246ff0d5cc1ed752401b9796dfca63ea3ac6d015e09d87247c6f78d0fd7100b040849b')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pylibemu() {
  depends=('python2' 'libemu')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pylibemu() {
  depends=('python' 'libemu')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

